<?php
/**
 * Created by JetBrains PhpStorm.
 * User: P2DC
 * Date: 26/7/2556
 * Time: 10:38 น.
 * To change this template use File | Settings | File Templates.
 */

function __autoload($class)
{
    foreach(glob('class/*.class.php') as $key => $value){
        $file = pathinfo($value);
        if($file['basename'] == $class.'.class.php'){
            include_once $value;
            break;
        }
    }
    foreach(glob('class/*/*.class.php') as $key => $value){
        $file = pathinfo($value);
        if($file['basename'] == $class.'.class.php'){
            include_once $value;
            break;
        }
    }
    if (!class_exists($class, false)) {
        trigger_error("Not found class", E_USER_WARNING);
    }
}

try {
    Cron::instance()->actionProductStatus();
    Log::cron('Complete');
}
catch (Exception $e) {
    Log::cron($e);
}